﻿@model Testicide.Models.Module

@{
    ViewBag.Title = "Details";
}


    <div class="order">
        <h3>@Model.Name</h3>
        <table class="table table-hover" style="border:thin;">
            <tr>
                <th>
                    <a id="addNewFeature" href="@Url.Action("Create","Feature", new { Model.ID })">Add Feature<img id="add" style="margin-left: 20px; width: 25px; height: 25px;" src="~/pictures/addnew.png"></a>
                </th>
                <th>
                    @using (Html.BeginForm("Search", "Feature"))
                    {
                        <input id="searchtxt" name="searchtxt" type="text" />
                        <button style="width: 20px; height: 20px; border:none; background-color:white;"><img id="search" style="background-color: none; border: none; width: 20px; height: 20px;" src="~/pictures/search.png" /></button>
                    }
                </th>

            </tr>
            @foreach (var item in Model.Features)
            {
                <tr>
                    <td>
                        <a id="detailsFeature_@item.ID" href="@Url.Action("Details","Feature", new { id=item.ID })">@item.Name</a>
                    </td>
                    <td>
                        <a id="editFeature_@item.ID" href="@Url.Action("Edit","Feature", new { id=item.ID })">
                            <img class="icons" src="~/pictures/edit.png" />
                        </a>|
                        <a id="deleteFeature_@item.ID" href="@Url.Action("Delete","Feature", new { id=item.ID })">
                            <img class="icons" src="~/pictures/delete.png" />
                        </a>
                    </td>

                </tr>
            }
        </table>
    </div>

@section Scripts
{
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $('#searchtxt').autocomplete({
                source: '@Url.Action("AutoComplete","Feature")'
            });
                })
    </script>
}